package com.oamicnet.servicetwo.server.controller;

import com.oamicnet.servicetwo.server.manager.ProductInfoManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/service-two-server/api/products")
public class ProductInfoController {
    @Autowired
    private ProductInfoManager productInfoManager;

    /**
     * 更新商品库存
     */
    @PutMapping("/{id}/stock")
    public void updateStock(@PathVariable("id") Long id, @RequestParam("stock") Integer stock) {
        productInfoManager.updateProductStock(id, stock);
    }
}
